// PresentationModelBase.cs
//
// Copyright (c) 2009 Mike Strobel
//
// This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
// For details, see <http://www.opensource.org/licenses/ms-rl.html>.
//
// All other rights reserved.

using System;
using System.ComponentModel;

using Supremacy.Annotations;

namespace Supremacy.Client.Views
{
    public class PresentationModelBase : IPresentationModel
    {
        private readonly IClientContext _clientContext;

        public PresentationModelBase([NotNull] IClientContext clientContext)
        {
            if (clientContext == null)
                throw new ArgumentNullException("clientContext");
            _clientContext = clientContext;
        }

        protected virtual void OnLoaded() {}
        protected virtual void OnUnloaded() {}

        #region Implementation of IPresentationModel
        protected IClientContext ClientContext
        {
            get { return _clientContext; }
        }

        public void NotifyLoaded()
        {
            OnLoaded();
        }

        public void NotifyUnloaded()
        {
            OnUnloaded();
        }
        #endregion
    }
}